1. Field of the Invention
The present invention relates to a data storage device for downloading, into a rewritable non-volatile memory such as a flash memory, control data such as a variety of programs and information for controlling operations of an electronic device.
2. Description of Related Art
Electronic devices, such as printers, are exported to various countries around the world. Often, specifications of the electronic devices differ depending on the target country, to which the electronic devices are to be shipped out. Even though the target country, to which the electronic devices are to be shipped out, are the same, specifications of the electronic devices will still differ depending on a model type of the electronic devices.
It is noted that when a different control board is produced and mounted to an electronic device for each different model and for each target county, then the number of parts mounted in the electronic devices will increase.
In view of this problem, recently a general use control board is mounted in each electronic device. The control board is produced to mount thereon a flash memory as a program memory device. Only a main program downloaded to the flash memory is changed according to the model type and to the target country. In more detail, a common boot loader program is prestored in the flash memory. The boot loader is the same for all the countries and for all the model types. The boot loader is used to download a main program especially for each country and for each model type into the flash memory. The electronic device thus mounted with the control board stored with the main program is treated as a corresponding model and shipped out to a corresponding country.
After the electronic device stored with the main program is shipped out and purchased by a user, the user will sometimes need to update the main program.
It is noted, however, that the user will possibly download an update program with different specifications into his/her electronic device. When the user thus erroneously downloads the main program with different specifications, differences between countries and models can interfere with operations of the electronic device.
Because the Internet is recently used in common, it is conceivable to simply distribute update main programs over the Internet even to the overseas clients. In the future, a manufacturer of the electronic device can produce a homepage with a plurality of links to a plurality of update main programs corresponding to different countries and to different model types. The user may download, into his or her personal computer, one of the update main programs that corresponds to his or her electronic device. The user then downloads the update main program into his or her electronic device. It should be noted that the processes for updating the main program is one of a download process because the updating process includes the process for downloading an update program into the flash memory.
Although the above-described conceivable method for distributing programs is convenient, using the Internet can let the user accidentally select an erroneous link of the homepage and download programs with different specifications. When this happens, because the electronic device is mounted with the general boot loader, the main program of the electronic device will be erroneously exchanged with a program for a different specification.
Especially when the electronic device is a printer, the printer is generally used as being connected to a personal computer. When performing printing operations, the printer will output a busy signal to the personal computer to instruct the computer not to send new print data to the printer because the printer is presently being busy in performing printing operations for the already-received print data. When the printer runs out of paper, the printer will output a paper empty signal to the personal computer to inform that the printer can not perform printing operations any more.
When the printer outputs the control signal, such as the busy signal and the paper empty signal, to the personal computer, the personal computer can not transmit print data or a variety of control signals to the printer. The personal computer can not transmit, to the printer, even the update main program data that has been downloaded to the personal computer. This is extremely inconvenient because the user can not update the main program when he or she needs to.
It is convenient that not only the main program but also the boot loader program can be updated through downloading an update boot loader program into the electronic device. It is conceivable to download the update boot loader program into the electronic device through the Internet in the same manner as described above for the main program.
It is conceivable that the electronic device updates or exchanges the main program or the boot loader program with newly-received program data while referring only to address data appended to the program data. Accordingly, when the electronic device receives program data with errors in the address data, the electronic device will erroneously rewrite the boot loader program. The boot loader program serves as an extremely important role for controlling loading operations of a main program. Accordingly, such an erroneously-rewritten boot loader program may prevent the electronic device from even starting up.
It is conceivable to solve this problem using hardware. For example, it is conceivable to perform a predetermined setting to one or more data input/output pin (IO pin) provided to the flash memory, thereby prohibiting the boot loader program from erroneously being rewritten. This method is, however, troublesome.
It is therefore an objective of the present invention to solve the above-described problems, and to provide an improved data storage device that can properly download control data, such as the program for controlling the electronic device, into the flash memory through selectively allowing the download operation.
In order to attain the above and other objects, the present invention provides a data storage device, comprising: a rewritable nonvolatile memory capable of storing control data; means for selectively setting a predetermined download operation mode; and means for performing a downloading operation to receive inputted control data and to write the received control data to the nonvolatile memory according to the selectively-set download operation mode.
The mode setting means may include means for selectively setting one of a rewritable mode to allow the downloading means to write the inputted control data over the control data already stored in the nonvolatile memory and an initially-writing mode to allow the downloading means to write the inputted control data initially into the nonvolatile memory.
The data storage device may further comprise means for executing operations based on the control data stored in the nonvolatile memory.
According to another aspect, the present invention provides a data storage device comprising: a rewritable nonvolatile memory including: a control data storing region for storing control data such as a program and a variety of information for controlling operations of an electronic processing device; and a specification indication data storage region storing specification indication data for indicating specifications of the electronic processing device to be controlled by the control data; reception means for receiving transmitted control data and specification indication data; collating means for, when the reception means receives the transmitted specification indication data, collating the transmitted specification indication data with the specification indication data stored in the specification indication data storage region; updating means for, when the transmitted specification indication data and the specification indicated data collated by the collation means match, rewriting the control data storage region using the transmitted control data received by the reception means; and mode setting means for setting a specific rewritable mode for rewriting the control data storage region using the transmitted control data received by the reception means, the updating means rewriting, during the specific rewritable mode set by the mode setting means, the control data storage region using the transmitted control data received by the reception means even when the transmitted specification indication data and the specification indication data collated by the collation means do not match and even when the collation means does not perform the collating operation.
According to a further aspect, the present invention provides a data rewriting device comprising: a rewritable nonvolatile memory including: a control data storing region for storing control data such as a program and a variety of information for controlling operations of an electronic processing device; and a loader program storage region for storing loader program data for controlling load operations of the control data into the control data storing region during both initial load of the control data and update of the control data; reception means capable of receiving transmitted control data and loader program data transmitted from an external transmission device; mode setting means for setting a rewrite mode enabling rewrite of the transmitted loader program data; and rewrite means for, when the mode setting means sets the rewrite mode, rewriting the loader program storing region using the transmitted loader program data received by the reception means.
Each of the control data and the loader program data may be appended with different address data. The data rewrite device may further comprise judgement means for judging whether transmitted data received by the reception means is control data based on the appended address data, the rewrite means rewriting the control data storing region using the transmitted control data when the judgement means judges that the transmitted data received by the reception means includes control data. The data rewrite device may further comprise means for deleting the transmitted data received by the reception means when the judgement means judges, while the rewrite mode is not being set, that the transmitted data received by the reception means is not control data.
According to another aspect, the present invention provides a printing system comprising: a print device including: transmission/reception means capable of receiving print data and control data and for transmitting a specific control signal indicative of condition of the print device; print means for printing images on a print medium based on the received print data; and a rewritable nonvolatile memory for storing the control data such as programs and a variety of information for controlling operations of the print means; an external transmission device, connected to the print device, for transmitting the control data and the print data and for receiving the specific control signal; prevention means for outputting a prevention signal to the transmission/reception means to prevent the transmission/reception means from transmitting the specific control signal; and update means for, when the prevention means outputs the prevention signal, rewriting the nonvolatile memory using transmitted control data.
The prevention means and the update means may be provided in the print device. The specific control signal may include at least one of a print medium empty signal and a busy signal that are outputted corresponding to a printing impossible condition of the print means.
According to still another aspect, the present invention provides a data storage device comprising: a rewritable nonvolatile memory for storing control data such as a program and a variety of information for controlling operations of an electronic processing device; download means for downloading control data to the nonvolatile memory; and notification means for externally notifying load process condition using a different notification form for each load process step, from when download of control data by the download means is started until when download is completed.